//
//  WithdrawalVC.m
//  Logistics
//
//  Created by enzhoukeji on 2018/8/11.
//  Copyright © 2018年 puyue.com. All rights reserved.
//

#import "WithdrawalVC.h"

@interface WithdrawalVC ()
@property (nonatomic,strong) UIView *headView;
@property (nonatomic,strong) UIView  *secondView;
@property (nonatomic,strong) UITextField *placeText;

@end

@implementation WithdrawalVC

- (void)viewDidLoad {
    [super viewDidLoad];
    self.navTitle = @"提现";
    self.view.backgroundColor = [UIColor colorWithRed:243/255.0 green:243/255.0 blue:243/255.0 alpha:1];
    [self createUIView];
    // Do any additional setup after loading the view.
}
-(void)createUIView {
    UILabel * titlelabel = [UILabel labelWithSize:[UIFont systemFontOfSize:15] withColor:[UIColor blackColor] withText:@"到账银行"];
    self.headView = [UIView new];
    self.headView.backgroundColor = [UIColor whiteColor];
    UIImageView* titleImage = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"shangchuanweixiu"]];
    UILabel * bankLabel = [UILabel labelWithSize:[UIFont systemFontOfSize:14] withColor:[UIColor blackColor] withText:@"农业银行"];
    UILabel * numberLabel = [UILabel labelWithSize:[UIFont systemFontOfSize:12] withColor:[UIColor blackColor] withText:@"储蓄卡尾号 1234"];
    UIImageView* jiantouImage = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"jiantou"]];
    
    self.secondView = [UIView new];
    self.secondView.backgroundColor = [UIColor whiteColor];
    UILabel * withLabel = [UILabel labelWithSize:[UIFont systemFontOfSize:15] withColor:[UIColor blackColor] withText:@"提现金额"];
    UIImageView* moneyImage = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"shangchuanweixiu"]];
    self.placeText = [UITextField new];
    self.placeText.placeholder = @"请输入提现金额";
    self.placeText.font = [UIFont systemFontOfSize:16];
    UILabel * linLabel = [UILabel new];
    linLabel.backgroundColor = [UIColor colorWithRed:243/255.0 green:243/255.0 blue:243/255.0 alpha:1];
    UILabel  * canLabel = [UILabel labelWithSize:[UIFont systemFontOfSize:14] withColor:[UIColor blackColor] withText:@"可提现金额:10000元"];
    UIButton * allBut = [UIButton buttonWithTitle:@"全部提现" withImageName:nil withBGColor:nil Withlayer:YES];
    allBut.layer.cornerRadius = 5;
    [allBut setTitleColor:[UIColor colorWithRed:106/255.0 green:181/255.0 blue:231/255.0 alpha:1] forState:UIControlStateNormal];
    allBut.layer.borderColor = [UIColor colorWithRed:106/255.0 green:181/255.0 blue:231/255.0 alpha:1].CGColor;
    allBut.layer.borderWidth = 1.0;


    
    [self.view addSubview:titlelabel];
    [self.view addSubview:self.headView];
    [self.headView addSubview:titleImage];
    [self.headView addSubview:bankLabel];
    [self.headView addSubview:numberLabel];
    [self.headView addSubview:jiantouImage];
    [self.view addSubview:self.secondView];
    [self.secondView addSubview:withLabel];
    [self.secondView addSubview:moneyImage];
    [self.secondView addSubview:self.placeText];
    [self.secondView addSubview:linLabel];
    [self.secondView addSubview:canLabel];
    [self.secondView addSubview:allBut];
    
    
    [titlelabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(GTFixWidthFlaot(20));
        make.top.mas_equalTo(kMainTopHeight + GTFixHeightFlaot(10));
        make.height.mas_equalTo(GTFixHeightFlaot(30));
        make.width.mas_equalTo(titlelabel.mas_width);
    }];
    [self.headView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(GTFixWidthFlaot(0));
        make.top.mas_equalTo(titlelabel.mas_bottom).offset(0);
        make.height.mas_equalTo(GTFixHeightFlaot(40));
        make.width.mas_equalTo(kMainScreen_width);
    }];
    [titleImage mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(GTFixWidthFlaot(30));
        make.top.mas_equalTo(GTFixHeightFlaot(5));
        make.height.width.mas_equalTo(GTFixHeightFlaot(30));
    }];
    [bankLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(titleImage.mas_right).offset(GTFixHeightFlaot(5));
        make.top.mas_equalTo(titlelabel.mas_bottom).offset(0);
        make.bottom.mas_equalTo(0);
        make.width.mas_equalTo(bankLabel.mas_width);
    }];
    [numberLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.mas_equalTo(GTFixWidthFlaot(-40));
        make.top.mas_equalTo(titlelabel.mas_bottom).offset(0);
        make.bottom.mas_equalTo(0);
        make.width.mas_equalTo(numberLabel.mas_width);
    }];
    [jiantouImage mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.mas_equalTo(GTFixWidthFlaot(-20));
        make.top.mas_equalTo(titlelabel.mas_bottom).offset(0);
        make.bottom.mas_equalTo(0);
        make.width.mas_equalTo(GTFixHeightFlaot(20));
    }];
    [self.secondView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(GTFixWidthFlaot(0));
        make.top.mas_equalTo(self.headView.mas_bottom).offset(GTFixHeightFlaot(10));
        make.height.mas_equalTo((kMainScreen_height - kMainTopHeight)/3);
        make.width.mas_equalTo(kMainScreen_width);
    }];
    [withLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(GTFixWidthFlaot(20));
        make.top.mas_equalTo(GTFixHeightFlaot(10));
        make.height.mas_equalTo(GTFixHeightFlaot(20));
        make.width.mas_equalTo(withLabel.mas_width);
    }];
    [moneyImage mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(GTFixWidthFlaot(20));
        make.top.mas_equalTo(withLabel.mas_bottom).offset(GTFixHeightFlaot(15));
        make.height.mas_equalTo(GTFixHeightFlaot(30));
        make.width.mas_equalTo(GTFixWidthFlaot(20));
    }];
    [self.placeText mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(moneyImage.mas_right).offset(GTFixWidthFlaot(5));
        make.top.mas_equalTo(withLabel.mas_bottom).offset(GTFixHeightFlaot(15));
//        make.centerY.mas_equalTo(moneyImage.centerY);
        make.height.mas_equalTo(GTFixHeightFlaot(30));
        make.width.mas_equalTo(kMainScreen_width - GTFixWidthFlaot(80));
    }];
    [linLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(GTFixWidthFlaot(0));
        make.top.mas_equalTo(moneyImage.mas_bottom).offset(GTFixHeightFlaot(0));
        make.height.mas_equalTo(GTFixHeightFlaot(1));
        make.width.mas_equalTo(kMainScreen_width);
    }];
    [canLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(GTFixWidthFlaot(20));
        make.top.mas_equalTo(linLabel.mas_bottom).offset(GTFixHeightFlaot(30));
        make.height.mas_equalTo(GTFixHeightFlaot(20));
        make.width.mas_equalTo(canLabel.mas_width);
    }];
    [allBut mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.mas_equalTo(GTFixWidthFlaot(-30));
        make.centerY.mas_equalTo(canLabel.mas_centerY);
        make.height.mas_equalTo(GTFixHeightFlaot(25));
        make.width.mas_equalTo(GTFixWidthFlaot(70));
    }];
//
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
